package com.ydw.scheduled;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author ydw
 * @create 2017-07-07 上午9:20
 **/
@Component
public class MyScheduled {
    @Scheduled(fixedDelay = 5000)
    public void print(){
        System.out.println("每隔5秒打印这句话"+Thread.currentThread().getName());
    }

    @Scheduled(fixedDelay = 1000)
    public void print_(){

        System.out.println("每隔一秒打印"+Thread.currentThread().getName());
    }
}
